package com.ucar.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.ucar.common.interceptor.LogExecuteMethodOfControllerInterceptor;
/**
 * 将自定义的拦截器注册在 WebMvcConfigurerAdapter
 * @author dinghao
 *
 */
@Configuration
public class LogExecuteMethodOfControllerConfig extends WebMvcConfigurerAdapter{

	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(logExecuteMethodOfControllerInterceptor());
	}

	@Bean
	public LogExecuteMethodOfControllerInterceptor logExecuteMethodOfControllerInterceptor() {
		return new LogExecuteMethodOfControllerInterceptor();
	}
	
}
